package com.attendance.service.impl;

import com.attendance.entity.*;
import com.attendance.mapper.TeamMapper;
import com.attendance.service.TeamService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeamServiceImpl implements TeamService {

    @Resource
    TeamMapper mapper;

    @Override
    public void insert(Team team) {
        mapper.insert(team);
    }

    @Override
    public Integer selectUserIdByEmail(String email) {
        return mapper.selectUserIdByEmail(email);
    }

    @Override
    public List<Team> selectTeamByUserID(Integer id) {
        return mapper.selectTeamByUserID(id);
    }

    @Override
    public Team selectTeamOneByUserId(Integer id) {
        return mapper.selectTeamOneByUserId(id);
    }

    @Override
    public List<Team> selectTeamByUserIDLeave(Integer id) {
        return mapper.selectTeamByUserIDLeave(id);
    }

    @Override
    public List<Cpxm> selectCPXM() {
        return mapper.selectCPXM();
    }

    @Override
    public List<Cpxh> selectCPXH() {
        return mapper.selectCPXH();
    }

    @Override
    public List<CpDTO> selectByGroup(Integer cpxm_id) {
        return mapper.selectByGroup(cpxm_id);
    }

    @Override
    public int insertCpxm(Cpxm cpxm) {
        return mapper.insertCpxm(cpxm);
    }

    @Override
    public int insertCpxh(Cpxh cpxh) {
        return mapper.insertCpxh(cpxh);
    }

    @Override
    public int insertCp(CpxmCpxh cp) {
        return mapper.insertCp(cp);
    }

    @Override
    public Cpxh selectByKeyAndLabel(Cpxh cpxh) {
        return mapper.selectByKeyAndLabel(cpxh);
    }

    @Override
    public List<TeamMemberDTO> selectTeamMemberById(Integer team_id) {
        return mapper.selectTeamMemberById(team_id);
    }

    @Override
    public int updateUserName(TeamMemberDTO teamMemberDTO) {
        return mapper.updateUserName(teamMemberDTO);
    }

    @Override
    public int updateCpxh(Cpxh cpxh) {
        return mapper.updateCpxh(cpxh);
    }

    @Override
    public int updateCpxm(Cpxm cpxm) {
        return mapper.updateCpxm(cpxm);
    }

    @Override
    public int deleteCpxh(Integer id) {
        return mapper.deleteCpxh(id);
    }

    @Override
    public int deleteCpxmCpxh(Integer id) {
        return mapper.deleteCpxmCpxh(id);
    }

    @Override
    public int deleteCpxm(Integer id) {
        return mapper.deleteCpxm(id);
    }

    @Override
    public int deleteCpxhCpxm(Integer id) {
        return mapper.deleteCpxhCpxm(id);
    }

    @Override
    public int deleteTeamUser(Integer id) {
        return mapper.deleteTeamUser(id);
    }

    @Override
    public List<User> searchUser(String email) {
        return mapper.searchUser(email);
    }

    @Override
    public Team selectByTeamId(Integer team_id) {
        return mapper.selectByTeamId(team_id);
    }

    @Override
    public int addTeamUser(TeamUser teamUser) {
        return mapper.addTeamUser(teamUser);
    }

    @Override
    public History selectHistoryByFileName(String name) {
        return mapper.selectHistoryByFileName(name);
    }

    @Override
    public int insertHistory(History history) {
        return mapper.insertHistory(history);
    }

    @Override
    public List<History> selectHistoryByTeamId(Integer id) {
        return mapper.selectHistoryByTeamId(id);
    }

    @Override
    public List<Team> searchTeam(String team_name) {
        return mapper.searchTeam(team_name);
    }

    @Override
    public List<Team> selectJoinTeam(Integer uid) {
        return mapper.selectJoinTeam(uid);
    }

    @Override
    public TeamUser selectTeamUser(Integer uid) {
        return mapper.selectTeamUser(uid);
    }

    @Override
    public void insertTeamUser(TeamUser teamUser) {
        mapper.insertTeamUser(teamUser);
    }

    @Override
    public List<TeamUserListDTO> selectUserListByTeam(Integer tId) {
        return mapper.selectUserListByTeam(tId);
    }

    @Override
    public int updateTutByIdRID(TutDTO tutDTO) {
        return mapper.updateTutByIdRID(tutDTO);
    }


}
